import request from '@/utils/request'
import { DeleteInfo, EditInfo, TableRow } from './type'

enum API {
  CARBON_LABEL = '/carbon/label',
  // 编辑
  EDIT_LABEL = '/carbon/label/edit',
  DELETE_LABEL = '/carbon/label/delete',
}
export const reCarbonLabel = () => {
  const res = request.get<any, TableRow[]>(API.CARBON_LABEL)
  return res
}
export const reDeleteLabel = (rowData) => {
  const res = request.delete<any, DeleteInfo>(API.DELETE_LABEL, {
    data: rowData,
  })
  return res
}
export const reEditLabel = (rowData) => {
  const res = request.put<any, EditInfo>(API.EDIT_LABEL, rowData)
  return res
}
